Skip to content

fix(qt): render the value readout in the format the attribute declared - #58

Merged
otto-link merged 1 commit into
devfrom
fix/industrial-value-format
Sep 7, 2026
Merged

fix(qt): render the value readout in the format the attribute declared#58
otto-link merged 1 commit into
devfrom
fix/industrial-value-format

Conversation

@Leonhardmaster2

Copy link
Copy Markdown
Contributor

the readout always rendered fixed no matter what the attribute asked for.
HydraulicParticle declares its rates as "{:.2e}" over [1e-6, 1e-1] exactly so
the readout stays a short mantissa plus an exponent. rendered fixed, 1e-3 comes
out as 0.00100000, overruns the value field and clips to a run of zeroes with
no decimal point left in it, which is the 000001 you saw.

it keeps the whole spec now instead of reducing it to a decimal count, and
anything whose presentation type is e/E/g/G goes through std::vformat.
everything else still goes through display_float so a small value under a fixed
spec keeps widening rather than rounding away to 0.00. a malformed spec falls
back instead of throwing.

test_slider_mapping covers both, "{:.2e}" on 1e-3 now reads 1.00e-03 and
"{:.2f}" on 0.001 still reads 0.001.

worth saying: the log rail itself was already fixed in #57, hesiod dev was just
still pinned at the merge of #56 so none of it was in your build. bump is
ottolink-dev/Hesiod#753.

The industrial readout always rendered fixed, whatever the attribute
asked for. HydraulicParticle declares its rates as "{:.2e}" over
[1e-6, 1e-1] precisely so the readout stays a short mantissa and an
exponent; rendered fixed, 1e-3 becomes 0.00100000, overruns the value
field and clips to a run of zeroes with no decimal point visible. That
is the 000001 in the reported screenshot.

The whole spec is kept now rather than being reduced to a decimal count,
and a spec whose presentation type is e, E, g or G is rendered through
std::vformat. Everything else still goes through display_float, which
widens precision rather than letting a small non-zero value round away
to 0.00, so the fixed case keeps the behaviour it was given.

A malformed spec falls back rather than throwing: that is a host bug and
not a reason for a row to render nothing.
@otto-link
otto-link merged commit 341a253 into dev Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants